typedef struct style_vecs {
const char *name;
const char *style_buf;
+ const char *desc;
+ const char *ext;
} style_vecs_t;
+extern style_vecs_t style_list[];
typedef struct filter_vecs {
filter_init f_init;
void rtrim(char *s);
signed int get_tz_offset(void);
+const char *get_cache_icon(const waypoint *waypointp);
/*
* PalmOS records like fixed-point numbers, which should be rounded
icon_token = mag_find_token_from_descr(waypointp->icon_descr);
}
- /*
- * For icons, type overwrites container. So a multi-micro will
- * get the icons for "multi".
- */
- switch (waypointp->gc_data.container) {
- case gc_micro:
- icon_token = mag_find_token_from_descr("Micro-Cache");
- break;
- }
- switch (waypointp->gc_data.type) {
- case gt_virtual:
- icon_token = mag_find_token_from_descr("Virtual cache");
- break;
- case gt_multi:
- icon_token = mag_find_token_from_descr("Multi-Cache");
- break;
- default:
- break;
+ if (get_cache_icon(waypointp)) {
+ icon_token = mag_find_token_from_descr(get_cache_icon(waypointp));
}
+
isrc = waypointp->notes ? waypointp->notes : waypointp->description;
owpt = global_opts.synthesize_shortnames ?
mkshort(mkshort_handle, isrc) : waypointp->shortname,
return (signed int) difftime(now, later);
}
}
+
+/*
+ * Return a pointer to a constant string that is suitable for icon lookup
+ * based on geocache attributes. The strings used are those present in
+ * a GPX file from geocaching.com. Thus we sort of make all the other
+ * formats do lookups based on these strings.
+ */
+const char *
+get_cache_icon(const waypoint *waypointp)
+{
+ /*
+ * For icons, type overwrites container. So a multi-micro will
+ * get the icons for "multi".
+ */
+ switch (waypointp->gc_data.container) {
+ case gc_micro:
+ return "Micro-Cache";
+ break;
+ }
+ switch (waypointp->gc_data.type) {
+ case gt_virtual:
+ return "Virtual cache";
+ case gt_multi:
+ return "Multi-Cache";
+ break;
+ default:
+ break;
+ }
+ return NULL;
+}